package com.itheima.day06.myLocalDateTime.test2;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class Test {
    public static void main(String[] args) {
        LocalDateTime of = LocalDateTime.of(2000, 01, 02, 03, 04, 05);
        System.out.println(of);

//        public int getYear()	获取年
        int year = of.getYear();
        System.out.println("年：" + year);

//        public int getMonthValue()	获取月份（1-12）
        int monthValue = of.getMonthValue();
        System.out.println("月：" + monthValue);

//        public int getDayOfMonth()	获取月份中的第几天（1-31）
        int dayOfMonth = of.getDayOfMonth();
        System.out.println("天：" + dayOfMonth);

//        public int getDayOfYear()	获取一年中的第几天（1-366）
        int dayOfYear = of.getDayOfYear();
        System.out.println("一年的第几天：" + dayOfYear);

//        public DayOfWeek getDayOfWeek()	获取星期
        DayOfWeek dayOfWeek = of.getDayOfWeek();
        System.out.println("星期：" + dayOfWeek);

//        public int getMinute()	获取分钟
        int minute = of.getMinute();
        System.out.println("分：" + minute);

//        public int getHour()	获取小时
        int hour = of.getHour();
        System.out.println("时：" + hour);
    }

}
